/**********************************************************************
*
*   strong_symbol.c
*   定义库里面部分WEAK函数的Strong函数，动态关闭库代码
***********************************************************************/
#include "include.h"

uint32_t cfg_sdk_version = SDK_VERSION;

#if (!ADAPTER_USB_MIC_RX_EN)
void usb_dev_isr(void){}
void ude_ep_reset(void){}
void ude_control_flow(void){}
void ude_isoc_tx_process(void){}
void ude_isoc_rx_process(void){}
void ude_hid_rx_process(void){}
void lock_code_usbdev(void){}
#endif //FUNC_USBDEV_EN

#if (REC_TYPE_SEL != REC_MP3)
int mpa_encode_frame(void) {return 0;}
#endif //(REC_TYPE_SEL != REC_MP3)

#if (REC_TYPE_SEL != REC_SBC)
#if (!BT_HFP_MSBC_EN)
bool msbc_encode_init(void){return false;}
#endif
void sbc_encode_process(void){}
#endif

#if (REC_TYPE_SEL != REC_ADPCM && !BT_HFP_REC_EN)
void adpcm_encode_process(void){}
#endif //(REC_TYPE_SEL != REC_ADPCM)

#if !MUSIC_WAV_SUPPORT
int wav_dec_init(void){return 0;}
bool wav_dec_frame(void){return false;}
void lock_code_wavdec(void){}
int wav_decode_init(void){return 0;}
#endif // MUSIC_WAV_SUPPORT

#if !MUSIC_WMA_SUPPORT
int wma_dec_init(void){return 0;}
bool wma_dec_frame(void){return false;}
void lock_code_wmadec(void){}
int wma_decode_init(void){return 0;}
#endif // MUSIC_WMA_SUPPORT

#if !MUSIC_APE_SUPPORT
int ape_dec_init(void){return 0;}
bool ape_dec_frame(void){return false;}
void lock_code_apedec(void){}
int ape_decode_init(void){return 0;}
#endif // MUSIC_APE_SUPPORT

#if !MUSIC_FLAC_SUPPORT
int flac_dec_init(void){return 0;}
bool flac_dec_frame(void){return false;}
void lock_code_flacdec(void){}
int flac_decode_init(void){return 0;}
#endif // MUSIC_FLAC_SUPPORT

#if !MUSIC_SBC_SUPPORT
int sbcio_dec_init(void){return 0;}
bool sbcio_dec_frame(void){return false;}
int sbcio_decode_init(void){return 0;}
#endif // MUSIC_SBC_SUPPORT

#if !MUSIC_AAC_SUPPORT
int aacio_dec_init(void) {return 0;}
bool aacio_dec_frame(void) {return false;}
int aacio_decode_init(void) {return 0;}
#endif

#if (!ADAPTER_AUX_TX_EN) && (!DEVICE_MIX_AUX_EN)
void sdadc_analog_aux_start(u8 channel, u8 gain){}
void sdadc_analog_aux_exit(u8 channel){}
#endif

#if !FUNC_MUSIC_EN
int mp3_decode_init(void){return 0;}
int music_decode_init(void){return 0;}
void mp3_get_total_time(void){}
void update_codec_playtime_callback(void *s){}
#endif

void sd_gpio_init(u8 type) {}
void sd1_gpio_init(u8 type) {}

//是否支持BT AAC音频
#if !BT_A2DP_AAC_AUDIO_EN
void aac_dec_init(void) {}
void aac_decode_init(void) {}
bool aac_dec_frame(void) {return false;}
bool aac_nor_dec_frame(void) {return false;};
bool aac_tws_dec_frame(void) {return false;};
void aac_cache_free_do(void) {}
size_t aac_cache_read_do(uint8_t *buf, uint max_size) {return 0;}
uint16_t tws_pack_aac(uint8_t *buf) {
    return 0;
}
AT(.com_text.aac.obuf)
void aac_fill_tws_obuf(void) {}
AT(.aacdec.text)
void aac_obuf_tws_cpy(void) {}
AT(.aacdec.text)
bool aac_decode(void) { return false; }
#else
void aac_decode_init_do(void);
bool aac_dec_frame_do(void);
void aac_cache_free_do(void);
size_t aac_cache_read_do(uint8_t *buf, uint max_size);
AT(.text.music.init.aac)
void aac_decode_init(void) {
    aac_decode_init_do();
}
AT(.aacdec.text)
bool aac_dec_frame(void) {
    return aac_dec_frame_do();
}
AT(.aacdec.text)
void aac_cache_free(void) {
#if BT_TWS_EN
    aac_cache_free_do();
#endif
}
AT(.aacdec.text)
size_t aac_cache_read(uint8_t *buf, uint max_size) {
#if BT_TWS_EN
    return aac_cache_read_do(buf, max_size);
#else
    return 0;
#endif
}
#endif

#if !USB_SUPPORT_EN
void usb_isr(void){}
void usb_init(void){}
#endif

#if !FUNC_MUSIC_EN
u32 fs_get_file_size(void){return 0;}
void fs_save_file_info(unsigned char *buf){}
void fs_load_file_info(unsigned char *buf){}
#endif // FUNC_MUSIC_EN

#if !BT_TWS_EN
//AT(.sbcdec.code)
//void sbc_cache_free(void) {
//}
//
//AT(.sbcdec.code)
//size_t sbc_cache_read(uint8_t **buf) {
//    return 0;
//}
//
//AT(.com_text.bb.tws)
//void bt_tws_ticks_isr(void) {
//}
#else
#endif


//#if !BT_FCC_TEST_EN || !LE_EN
//uint8_t vs_ble_test(void const *cmd) {
//    return 0x11;
//}
//uint8_t ble_test_start(void* params) {
//    return 0x0c;
//}
//uint8_t ble_test_stop(void) {
//    return 0x0c;
//}
//#endif

//#if BT_FCC_TEST_EN || FUNC_BT_FCC_EN
#if LE_EN
uint8_t vs_ble_test_do(void const *cmd);
uint8_t vs_ble_test(void const *cmd) {
    return vs_ble_test_do(cmd);
}
#endif
//#else
//AT(.com_text.bt21.isr.test.fcc)
//bool bt_acl_test_rx_end(uint8_t index, void *par) {
//    return false;
//}
//void hci_fcc_init(void) {}
//uint8_t vs_fcc_test_cmd(void const *param) {
//    return 0x11;
//}
//void huart_init(void)
//{
//}
//AT(.com_text.stack.uart_isr)
//bool bt_uart_isr(void) {
//    return false;
//}
//#endif


#if (!SYS_MAGIC_VOICE_EN) && (!BT_SCO_MAV_EN)
//void magic_voice_process(void) {}
//void mav_kick_start(void) {}
#endif

#if (!BT_SCO_MAV_EN)
AT(.bt_voice.mav)
void bt_sco_mav_process(u32 *ptr, u32 sample){}
#endif

#if !FUNC_SPDIF_EN
void spdif_pcm_process(void){}
bool spdif_smprate_detect(void) {    return false;}
void spdif_isr(void){}
#endif


#if ((!MUSIC_UDISK_EN)&&(!MUSIC_SDCARD_EN)&&(!MUSIC_SDCARD1_EN))
FRESULT fs_open(const char *path, u8 mode){return 0;}
FRESULT fs_read (void* buff, UINT btr, UINT* br){return 0;}
FRESULT fs_lseek (DWORD ofs, u8 whence){return 0;}
#endif


#if !I2S_DMA_EN
void i2s_isr(void) {}
void i2s_process(void) {}
#endif

#if !LE_EN
void ble_txpkt_init(void) {}
AT(.com_text.stack.ble.mtu)
u16 ble_get_gatt_mtu(void) { return 0; }
void btstack_ble_send_req(void) {}
int ble_send_notify_packet(void *context, void *buf) {return -1;}
void att_event_server_send(void) {}
//void hci_run_le_connection(void) {}
bool ble_event_cmd_complete(uint8_t *packet, int size) { return false; }
void ble_event_meta(uint8_t *packet, int size) {}
void btstack_ble_init(void) {}
void btstack_gatt_init(void) {}
void btstack_ble_update_conn_param(void) {}
void btstack_ble_set_adv_interval(void) {}

uint16_t tws_get_ble_service(uint8_t *data_ptr){return 0;}
void tws_set_ble_service(uint8_t *data_ptr, uint16_t size){}
uint16_t tws_ble_get_adv_info(uint8_t *data_ptr){return 0;}
void tws_ble_set_adv_info(uint8_t *data_ptr, uint16_t size){}
void tws_send_ble_service_cfm(void) {}
void tws_send_ble_service_continue_cfm(void) {}
uint16_t tws_get_ble_link(uint8_t *data_ptr) { return 0; }
uint16_t tws_set_ble_link(uint8_t *data_ptr, uint16_t size) { return 0; }
void tws_set_ble_service_continue(uint8_t *data_ptr, uint16_t size) {}
bool tws_ble_switch_save_pend(uint8_t type, uint8_t flag, uint32_t buf_ptr, uint16_t len) { return false; }
uint16_t tws_get_ble_service_continue(uint8_t *data_ptr) { return 0; }

typedef uint8_t (*bb_msg_func_t)(uint16_t index, void const *param);
typedef uint8_t (*bb_cmd_func_t)(uint16_t cmd, void const *param);
typedef uint8_t (*ll_cntl_func_t)(uint8_t opcode);

struct ll_cntl_pdu_info
{
    ll_cntl_func_t  func;
    const char*     desc;
    uint16_t        length;
    uint8_t         flag;
};

struct bb_msg_info
{
    uint16_t index;
    bb_msg_func_t func;
};

struct bb_cmd_info
{
    uint16_t index;
    bb_cmd_func_t func;
};

AT(.rodata.le.ll_proc)
const struct bb_cmd_info ll_hci_cmd_tbl[1] = {0};
AT(.rodata.le.ll_proc)
const struct bb_msg_info ll_msg_tbl[1] = {0};
AT(.rodata.le.ll_cntl)
const struct ll_cntl_pdu_info ll_cntl_pdu_tbl[1] = {0};
AT(.rodata.le.ll_proc)
const struct bb_msg_info mgr_hci_cmd_tbl[1] = {0};
void ll_init(uint8_t init_type) {}
uint8_t ll_start(uint8_t index, void *param) {return -1;}
void ll_stop(uint8_t index) {}
void ll_cntl_state_set(uint8_t index, uint8_t txrx, uint8_t state) {}
void ll_proc_timer_set(uint8_t index, uint8_t type, bool enable) {}
void ll_proc_timer_set_state(uint8_t index, uint8_t type, bool enable) {}
void ll_cntl_send(uint8_t index, void *pdu, ll_cntl_func_t tx_func) {}
void ll_cntl_tx_check(uint8_t index) {}
bool ble_adv_end_con_ind(void const *param) { return false; }
AT(.com_text.bb.ble.chs)
void ble_channel_assess(uint8_t channel, bool rx_ok, uint32_t ts) {}
AT(.com_text.bb.ble.end)
void ble_con_rx_end(uint8_t index, bool rx_ok, uint16_t rxchass) {}
AT(.com_text.bb.ble.prio)
void ble_con_prio_check(void *con) {}
void aes_init(uint8_t init_type) {};
void aes_result_handler(uint8_t status, uint8_t* result) {};
void ble_ecpy(uint8_t *key, uint8_t *enc_data) {}
#endif

#if !BT_PBAP_EN
//void pbap_client_init(void) {}
//void goep_client_init(uint8_t rfcomm_channel_nr) {}
void btstack_pbap(u8 param) {}
#endif

#if !DAC_DRC_EN
void drc_process(s16 *ldata, s16 *rdata) {}
AT(.mp3dec.dac)
void mpeg_pcm_output(void) {}
#endif

#if !WIRELESS_MIC_DRC_EN && !ADAPTER_MIX_DRC_EN && !ADAPTER_MIC_DRC_EN
bool drc_v3_init(const void *bin, int bin_size, drc_v3_cb_t *drc_cb) {return false;}
AT(.com_text.drc.weak)
s16 drc_v3_calc(s32 sample, drc_v3_cb_t *drc_cb) {return 0;}
#endif

#if !WIRELESS_MIC_DRC_EN && !ADAPTER_MIC_DRC_EN
bool mic_drc_set_by_res(u32 addr, u32 len, drc_v3_cb_t *drc_cb) {return false;}
bool mic_drc_proc(s16 *input, u16 samples, drc_v3_cb_t *drc_cb){return false;}
#endif

#if !BT_SCO_FAR_NR_EN
void nr_process(s16 *data) {}
void nr_init(u32 nt) {}
void far_ains2_process(s16 *data){}
void far_ains2_init(u32 nt, u8 fre_mid_min, u8 fre_high_min){}
void bt_sco_nr_process(u16 *ptr, u8 len) {}
#else
#if BT_SCO_FAR_NR_SELECT
void nr_process(s16 *data) {}
void nr_init(u32 nt) {}
#else
void far_ains2_process(s16 *data){}
void far_ains2_init(u32 nt, u8 fre_mid_min, u8 fre_high_min){}
#endif
#endif

#if !BT_SCO_DUMP_EN && !BT_AEC_DUMP_EN && !BT_SCO_FAR_DUMP_EN && !BT_AEC_FRE_DUMP_EN && !BT_EQ_DUMP_EN
void sco_huart_init(void){}
bool sco_huart_putcs(u8 type, u8 frame_num, const void *buf, uint len){return 0;}
AT(.nr_buf.dump)
s16 bt_sco_dump_buf[0][0];
#endif

#if !BT_AEC_DUMP_EN && !BT_SCO_FAR_DUMP_EN && !BT_EQ_DUMP_EN && !BT_AEC_FRE_DUMP_EN
void aec_audio_dump_init(void){}
void aec_audio_dump(u8 type, s16* ptr, u16 len, u8 ch){}
#endif

#if !BT_SCO_CALLING_NR_EN
AT(.bt_voice.sco)
u16 dnr_voice_maxpow_calling(u32 *ptr, u16 len){return 0;};
#endif

#if !BT_NLMS_AEC_EN
void nlms_aec_init(void){}
void nlms_aec_process(void){}
void nlp_aec_process_plus(short *farend, short *nearend_nr, short *nearend_mic, short *output){}
void nlms_far_buf_count_clear(u8 far_frame_len){}
#endif

#if !BT_NLMS_FRE_EN
void bt_fdnlms_init(void) {}
AT(.bt_voice.fdnlms.proc)
void bt_fdnlms_fill_far_buf(void) {}
AT(.bt_voice.fdnlms.proc)
void bt_fdnlms_block_proc(s32 *tmic_fft, s32 *fmic_fft) {};
AT(.bt_voice.fdnlms.proc)
void nlp_gain_dnn_mul(s32 *nearend_fft) {}
AT(.bt_voice.fdnlms.proc)
void bt_fdnlms_nlp_gain(s32 *nearend_fft) {}
#endif

#if !BT_AEC_EN
void aec_init(void) {}
void aec_process(void) {}
AT(.bt_voice.aec)
bool aec_isr(void) { return false; }
#else
    #if BT_SCO_DNN_EN && BT_SCO_DNN_MODE
    s16 far_temp[14][64] AT(.dnn_data.far_buf);
    #endif
#endif

#if BT_NLMS_AEC_EN || BT_AEC_EN || BT_NLMS_FRE_EN
void aec_init_dft(aec_cb_t *aec) {}
#endif

#if BT_NLMS_AEC_EN || BT_AEC_EN
void bt_noaec_process(u8 *ptr, u32 samples, int ch_mode) {}
#endif

#if !BT_AEC_EN || ((!BT_SNDP_EN || !BT_SNDP_MODE) && (!BT_SCO_AINS2_EN || !BT_SCO_AINS2_MODE) && (!BT_SCO_DNN_EN || !BT_SCO_DNN_MODE) && !BT_SNDP_DMIC_EN && !BT_SNDP_DMIC_DNN_EN && !BT_SCO_DMNS_EN)
AT(.bt_voice.aec)
void far_buf_count_clear(u8 far_frame_len){}
AT(.bt_voice.aec)
void mode1_far_buf_cov(s16* buf){}
#endif

#if !BT_ALC_EN
void alc_init(void) {}
void alc_process(void) {}
void alc_fade_in(s16 *buf) {}
void alc_fade_out(s16 *buf) {}
AT(.bt_voice.alc)
bool alc_isr(void) { return false; }
AT(.bt_voice.alc)
void bt_alc_process(u8 *ptr, u32 samples, int ch_mode) {};
#else
void alc_init_dft(alc_cb_t *alc) {}
#endif

#if !BT_SCO_AINS2_EN
void ains2_process(s16 *data){}
void ains2_init(u16 nt, u16 noise, u8 trumpet) {}
void ains2_plus_process(void) {}
void bt_ains2_plus_init(void) {}
void bt_ains2_plus_process(s16 *buf) {}
#endif

#if !BT_SCO_BCNS_EN
int bcns_process(s16 *data,s16 *vdata){return 0;}
void bcns_init(u32 nt, u32 vad_threshold, u8 enlarge){}
void bcns_plus_process(void){}
void bt_bcns_plus_process(s16 *buf){}
#endif

#if !BT_SCO_DMNS_EN && !BT_SCO_DMDNN_EN
void dmns_plus_process(void) {}
void bt_dmns_plus_process(s16 *buf) {}
void bt_dmns_init(dmns_cb_t *dmns_cb) {}
#endif

#if !BT_SCO_DMNS_EN
AT(.bt_voice.dmns.proc)
void dmns_fre_process(s32 *fft_in0, s32 *fft_in1) {}
void dmns_init(dmns_cb_t *dmns_cb) {}
#else
    #if !BT_SCO_DMNS_BF_TYPE
    AT(.dmns_text.bf1)
    void dmns_proc_bf_type1(s32 *f,s32 *f2) {}
    #else
    AT(.dmns_text.bf0)
    void dmns_proc_bf_type0(s32 *f,s32 *f2) {}
    #endif
#endif

#if !BT_SCO_DMDNN_EN
AT(.bt_voice.dmdnn.proc)
void dmdnn_fre_process(s32 *fft_in0, s32 *fft_in1) {}
void dmdnn_init(dmns_cb_t *dmdnn_cb) {}
#else
    #if !BT_SCO_DMDNN_MODEL_SET
    AT(.dmdnn_text.model1)
    void dmdnn_model1_proc(void *st_tmp, s32 *f,s32 *f2) {}
    void dmdnn_m1_init(void) {};
    #else
    AT(.dmdnn_text.model0)
    void dmdnn_model0_proc(void *st_tmp, s32 *f,s32 *f2) {}
    void dmdnn_m0_init(void) {};
    #endif
#endif

AT(.com_text.qtest)
bool tbox_qtest_en(void)
{
#if VUSB_TBOX_QTEST_EN
    return xcfg_cb.qtest_en;
#else
    return 0;
#endif
}

#if !DUEROS_SUPPORT_EN
AT(.dueros_text.dma.init.weak)
void dueros_dma_init(void) {}
AT(.com_text.dma.opus.sdadc.weak)
void opus_sdadc_process(u8 *ptr, u32 samples, int ch_mode) {}
AT(.com_text.dma.opus.enc.weak)
void dma_opus_enc_process(void){}
AT(.dueros_text.dma.le_frame)
bool is_le_buff_full(uint rsvd_num) {return true;}
AT(.com_text.dueros.spp_frame1)
bool is_spp_buff_full(uint rsvd_num) {return true;}
AT(.com_text.sndp)
void dma_sndp_process(s16 *buf){}
void dma_ble_client_cfg_callback(u16 handle, u8 cfg){};
void dma_spp_client_cfg_callback(u8 cfg);
#endif

void voice_assistant_enc_process(void);
void dma_opus_enc_process(void);
//AT(.com_text.opus)
//void opus_enc_process(void)
//{
//    dma_opus_enc_process();
//}

#if !BT_SPP_EN
void spp_txpkt_init(void) {}
AT(.com_text.spp.send_req)
void btstack_spp_send_req(void) {}
AT(.com_text.pp.send_pkt)
int spp_send_packet(void *context, void *buf) {return -1;}
AT(.com_text.spp.event_send)
void spp_event_send(void) {}
#endif

#if !BT_SNDP_DMIC_EN && !BT_SNDP_DMIC_DNN_EN
void sndp_dm_process(void) {}
void bt_sndp_dm_process(s16 *buf) {}
void bt_sndp_dmic_init(void) {}
void bt_sndp_dmic_exit(void) {}
AT(.com_text.dma.sndp)
void dma_sndp_dm_process(s16 *buf){}
void dmic_init_dft(dmic_cb_t *dmic){}
#else
    #if BT_SNDP_DMIC_DNN_EN
    AT(.bt_voice.sndp2_dm)
    void sndp_dm_v02_proc(s32* outY, s32* inX0, s32* inX1) {}
    void sndp_dm_v02_init(void *cfg) {}
    void dmic_init_dft(dmic_cb_t *dmic) {}
        #if !BT_SNDP_DMIC_DNN_NLMS_EN
        AT(.sndp3_dm_text.bf)
        void Sndp_FdBNlms_Process_Fixed_Dmv3(int* pErr, int* pEst, int* pRef, int* pDes, int* pRotFactor, void* p_sFdN, int* BinStepCtrlFactor, int inputQ) {}
        AT(.sndp3_dm_text.bf)
        int Sndp_GCC_EstNormlizedDelay_Fixed_Dmv3(int* pCohBuff, int* CX0X1, int* CX0X0, int* CX1X1, int CX0X0_Q, const int* weighFactor, int MaxDOA_Samp, int startBin, int EndBin, int FFTLen, int* tmpBuff) {return 0;}
        char g_NLMS_BUF[0]              AT(.sndp3_dm.sta);
        char g_shareBuf_2mV3[4104]      AT(.sndp3_dm.share);
        int  p_SeGain_Fixed_2mV3[257]   AT(.sndp3_dm.SeGain);
        int  BF_out_2mV3[512]           AT(.sndp3_dm.BF);
        #else   //BT_SNDP_DMIC_DNN_NLMS_EN模式空间紧张，需要调整一下
            #if BT_AEC_EN           //开硬件AEC需要挪一下远端缓存BUF空间才够
            s16 far_temp[14][64] AT(.bt_sndp.sndp3_dm);
            #elif BT_NLMS_FRE_EN    //开频域NLMS AEC要调整一下空间才够用
            int  p_SeGain_Fixed_2mV3[257] AT(.fdnlms.sndp3_dm.SeGain);
            #endif
        #endif
    #else
    AT(.bt_voice.sndp3_dm)
    void sndp_dm_v03_proc(s32* outY, s32* inX) {}
    void sndp_dm_v03_init(void) {}
    void sndp_dm_v03_config(sndp3_dm_cb_t *dm_cb) {}
    #endif
#endif

#if FOT_EN
u8 is_fot_update_en(void)
{
    return 1;
}
#endif

#if !VUSB_TBOX_QTEST_EN
void qtest_parm_init(void) {}
void qtest_only_pair(void) {}
void qtest_only_pair_process(void) {}
AT(.com_text.qtest)
u8 qtest_get_mode(void) {return 0;}
bool qtest_is_send_btmsg(void) {return false;}
#endif

#if !SDADC_SOFT_GAIN_EN
void sdadc_drc_soft_gain_proc(s16 *ptr, u32 samples, int ch_mode) {}
#endif

#if !BT_NEAR_AINS2_EN
void near_ains2_process(s16 *data, u8 alg_count) {}
void near_ains2_init(u32 nt, u8 fre_mid_min, u8 fre_high_min) {}
#endif

#if !BT_TRUMPET_NR_EN
void trumpet_denoise_init(u8 level) {}
void trumpet_denoise(int *fft_in) {}
#endif

#if !SMIC_DBG_EN && !DMIC_DBG_EN
AT(.bt_voice.test)
bool bt_call_test_process(u8 *ptr, u32 samples) { return false;}
#endif

#if !BT_HID_EN
void hid_device_init(void) {}
int bt_hid_is_connected(void) { return 0;}
void hid_establish_service_level_connection(void* bd_addr) {}
void hid_release_service_level_connection(void* bd_addr) {}
void btstack_hid_api(uint param) {}
const void *btstack_hid_tbl[0];
void btstack_hid_send(void) {}
bool bt_hid_send(void *buf, uint len, bool auto_release) { return false;}
bool bt_hid_is_send_complete(void) { return true;}
void hid_report_set(void *buf, uint len, bool auto_release) {}
#endif

#if !BT_SPATIAL_AUDIO_EN
void spatial_audio_init(void) {}
void sptl_audio_processs(void) {}
void spatial_audio_fade_process(void) {}
#endif


#if !BT_V3D_AUDIO_EN
void v3d_process(s16 *data_l, s16 *data_r, u8 flag) {}
void v3d_init(void) {}
#endif

#if !BT_VBASS_AUDIO_EN
void vbass_process_do(s16 *data_l, s16 *data_r) {}
void vbass_init(void) {}
#endif

#if !BT_HARMONIC_AUDIO_EN
void hd_process(s16 *ldata_buf, s16 *rdata_buf) {}
void hd_init(void) {}
#endif

#if !BT_AUTOWAH_AUDIO_EN
void aw_process(s16 *ldata_buf, s16 *rdata_buf) {}
void aw_init(void) {}
#endif

#if !BT_MUSIC_AUDIO_EN
void music_audio_process(void) {}
void bt_music_audio_init(u8 audio_type) {}
bool bt_music_audio_set_state(u8 music_audio) {return false;}
u8 bt_music_audio_get_state(void) {return 0;}
#endif

#if !BT_AVDTP_DYN_LATENCY_EN
void a2dp_set_latency_ms(uint32_t a2dp_latency_ms) {}
void a2dp_latency_check(){}
uint16_t a2dp_calc_latency(int8_t rssi, uint16_t rxpkt_ok) {return 0;}
#endif

#if !BT_A2DP_EXCEPT_RESTORE_PLAY_EN
void noload_set_play_state(uint8_t play_state){}
uint16_t noload_get_play_state(uint8_t play_state){return 0;}
void noload_clear_play_state(uint8_t play_state){}
void noload_reset_play_state() {}
#endif

#if !BT_SCO_DNN_MODEL_SET
AT(.dnn_text.model1)
void dnn_model1_proc(void *st_tmp, s32 *f) {}
void dnn_m1_init(void) {};
AT(.dnn_text.model0)
void dnn_model0_proc(void *st_tmp, s32 *f) {}
void dnn_m0_init(void) {};
#endif

#if !BT_A2DP_RECORD_DEVICE_VOL
void a2dp_save_dev_vol(void) {}
void a2dp_set_cur_dev_vol(uint8_t vol) {}
uint8_t a2dp_get_cur_dev_vol(void) {return 0xff;}
#endif

WEAK uint8_t bt_get_connected_num(void) {return 0;}

#if !BT_SPP_EN
void spp_establish_service_level_connection(void *bd_addr) {}
void spp_release_service_level_connection(void *bd_addr) {}
void remove_spp_connection_context(void * spp_connection) {}
void * provide_spp_connection_context_for_bd_addr(void *bd_addr) { return NULL; }
void spp_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) {}
void spp_service_flush(void) {}
void * get_spp_connection_context_for_bd_addr(void *bd_addr) { return NULL; }
void spp_init_var(void) {}
#endif

#if !BT_SCO_FADE_EN
void bt_voice_fade_init(u32 timeout) {}
AT(.bt_voice.sco.fade)
void bt_voice_fade_do(s16 *ptr, u32 samples, int ch_mode) {}
#else
AT(.bt_voice.sco.skip)
void bt_voice_skip_frame_do(s16 *ptr, u32 samples, int ch_mode) {}
#endif

#if !WARNING_ESBC_PLAY
AT(.com_text.esbc)
void esbc_sync_kick(void) {}
int esbc_init(void){return 0;}
int spi_esbc_decode_init(void){return 0;}
bool esbc_decode_frame(void){return false;}
bool esbc_res_play_kick(u32 addr, u32 len, bool kick){return true;}
#endif

#if !BT_SCO_DNN_EN && !BT_SCO_DMDNN_EN
AT(.bt_voice.sco)
bool bt_sco_dnn_en(void) {return 0;}
AT(.bt_voice.sco.dnn)
void dnn_far_upsample(s16 *out, s16 *in, u32 samples, u8 step) {}
#endif


///wireless emit端strong函数
void lc3_enc_mic_process(void) {}

#if (!WIRELESS_MIC_AINS3_EN && !ADAPTER_AINS3_EN)
void ains3_mic_proc_cb(void){}
void ains3_process(s16 *data){}
void ains3_mic_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params){}
void ains3_mic_init(u8 sample_rate, u16 samples){}
void ains3_mic_mute_set(uint8_t mute){}
uint8_t ains3_mic_mute_get(void){return 0;}
#endif

#if !WIRELESS_MIC_DNN_L1_EN
void dnn_L1_mic_proc_cb(void){}
#endif

#if !MAGIC_EN
void magic_mic_proc_cb(void){}
#endif

///wireless rec端strong函数
#if !WIRELESS_MIC_SNDP_EN
void sndp_process_sta(void) {}
void bt_sndp_process(s16 *buf) {}
void sndp_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params) {}
void sndp_audio_input_process(void) {}
void sndp_audio_output_callback_set(audio_callback_t callback) {}
void sndp_audio_mute_set(u8 mute) {}
void sndp_init(u8 sample_rate, u16 samples) {}
#endif

///wireless rec端strong函数
#if !WIRELESS_MIC_DNN_EN
void bt_dnn_init(u8 dnn_level,u8 dnn_mode_select){}
void bt_dnn_process(s16 *buf) {}
void dnn_sm_process(void) {}
void dnn_audio_mute_set(u8 mute) {}
void dnn_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params){}
void dnn_audio_output_callback_set(audio_callback_t callback){}
void dnn_audio_init(u8 sample_rate, u16 samples){}
#endif

#if !I2S_RX_AUDIO_EN
void iis_rx_kick_start(void){}
void iis_rx_callback_process(void){}
#endif // I2S_EXT_EN

#if !I2S_TX_AUDIO_EN
void iis_audio_out_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params){}
void iis_audio_out_audio_output_callback_set(audio_callback_t callback){}
void iis_audio_out_init(void){}
#endif

#if !MAGIC_EN
void magic_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params){}
void magic_audio_init(u8 sample_rate, u16 samples){}
#endif
void lc3_dec_mic_process(void) {}

#if !WIRELESS_MIC_HOWLING
void howling_init(u8 sample_rate, u16 samples){}
void howling_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params){}
void howling_mic_param_set(s32 magic_param){}
#endif

#if !WIRELESS_MIC_SOFT_EQ
bool sdadcl_set_soft_eq_by_res(u32 addr, u32 len){ return 0;}
bool soft_eq_set_by_res(u32 addr, u32 len, u8 *soft_eq){return 0;}
bool sdadcr_set_soft_eq_by_res(u32 addr, u32 len){ return 0; }
void sdadc_soft_eq_proc(s16 *ptr, u32 samples, int ch_mode){}
s16 soft_eq_biquad(s16 input, u8 *iir_filter_sb){ return 0; }
#endif

#if !WIRELESS_MIC_CODEC_OPUS
void opus_enc_mic_audio_input(u8 *ptr, u32 samples, int ch_mode, void *params) {}
void opus_enc_mic_process(void) {}
void opus_dec_mic_process(uint8_t mic_num, uint8_t tog) {}
void opus_dec_mic_audio_buf_input(u8 *ptr, u32 len, int ch_mode, void *params) {}
#endif

#if WIRELESS_CON_VERS == 0
//WEAK
uint8_t ble_con_channel_get(uint8_t link, uint16_t evt_cnt) {return 0;}

//STRONG
void ble_con_acl_tx_done_cb_v1(uint8_t link, uint8_t tx_idx);
void ble_con_acl_rx_done_cb_v1(uint8_t link, uint8_t rx_idx);
void ble_con_evt_start_do_cb_v1(uint8_t link);
void ble_con_end_cb_v1(uint8_t link);
void ble_con_established_cb_v1(uint8_t link);

AT(.com_text.ble.isr.con)
void ble_con_acl_tx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_tx_done_cb_v1(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_acl_rx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_rx_done_cb_v1(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_evt_start_do_cb(uint8_t link)
{
    ble_con_evt_start_do_cb_v1(link);
}

void ble_con_established_cb(uint8_t link)
{
    ble_con_established_cb_v1(link);
}

AT(.com_text.ble.isr.con)
void ble_con_end_cb(uint8_t link)
{
    ble_con_end_cb_v1(link);
}
#else
//WEAK
void ble_con_acl_tx_done_cb_v1(uint8_t link, uint8_t tx_idx) {}
void ble_con_acl_rx_done_cb_v1(uint8_t link, uint8_t rx_idx) {}
void ble_con_evt_start_do_cb_v1(uint8_t link) {}
void ble_con_established_cb_v1(uint8_t link) {}
#endif

#if WIRELESS_CON_VERS == 2
void ble_con_acl_tx_done(uint8_t link, uint8_t tx_idx);
void ble_con_acl_rx_done(uint8_t link, uint8_t rx_idx);
void ble_con_evt_start_do(uint8_t link);
void ble_con_end_cb_v3(uint8_t link);
void ble_t2r_v3_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt);
void ble_t2r_v3_init(uint8_t init_type);
uint8_t ble_t2r_v3_start(uint16_t con_handle, uint8_t test_rx);
uint8_t ble_t2r_v3_stop(uint16_t con_handle);

AT(.com_text.ble.isr.con)
void ble_con_acl_tx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_tx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_acl_rx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_rx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_evt_start_do_cb(uint8_t link)
{
    ble_con_evt_start_do(link);
}

void ble_con_established_cb(uint8_t link)
{
//    ble_con_established_cb_v3(link);
}

AT(.com_text.ble.isr.con)
void ble_con_end_cb(uint8_t link)
{
    ble_con_end_cb_v3(link);
}

AT(.com_text.ble.isr.con)
void ble_con_anchor_ts_update_cb(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt)
{
    ble_t2r_v3_anchor_ts_update(link, anchor_ts, anchor_hus, evt_cnt);
}

void ble_audio_init_cb(uint8_t init_type)
{
    return ble_t2r_v3_init(init_type);
}

uint8_t ble_audio_start_cb(uint16_t con_handle, uint8_t test_rx)
{
    return ble_t2r_v3_start(con_handle, test_rx);
}

uint8_t ble_audio_stop_cb(uint16_t con_handle)
{
    return ble_t2r_v3_stop(con_handle);
}
#else
void ble_t2r_v3_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt) {}
void ble_t2r_v3_init(uint8_t init_type) {}
uint8_t ble_t2r_v3_start(uint16_t con_handle, uint8_t test_rx) {return 0;}
uint8_t ble_t2r_v3_stop(uint16_t con_handle) {return 0;}
#endif

#if WIRELESS_CON_VERS == 3
void ble_con_acl_tx_done(uint8_t link, uint8_t tx_idx);
void ble_con_acl_rx_done(uint8_t link, uint8_t rx_idx);
void ble_con_evt_start_do(uint8_t link);
void ble_con_end_cb_v4(uint8_t link);
void ble_t2r_v4_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt);
void ble_t2r_v4_init(uint8_t init_type);
uint8_t ble_t2r_v4_start(uint16_t con_handle, uint8_t test_rx);
uint8_t ble_t2r_v4_stop(uint16_t con_handle);

AT(.com_text.ble.isr.con)
void ble_con_acl_tx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_tx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_acl_rx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_rx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_evt_start_do_cb(uint8_t link)
{
    ble_con_evt_start_do(link);
}

AT(.com_text.ble.isr.con)
void ble_con_end_cb(uint8_t link)
{
    ble_con_end_cb_v4(link);
}

void ble_con_established_cb(uint8_t link)
{
//    ble_con_established_cb_v4(link);
}

AT(.com_text.ble.isr.con)
void ble_con_anchor_ts_update_cb(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt)
{
    ble_t2r_v4_anchor_ts_update(link, anchor_ts, anchor_hus, evt_cnt);
}

void ble_audio_init_cb(uint8_t init_type)
{
    return ble_t2r_v4_init(init_type);
}

uint8_t ble_audio_start_cb(uint16_t con_handle, uint8_t test_rx)
{
    return ble_t2r_v4_start(con_handle, test_rx);
}

uint8_t ble_audio_stop_cb(uint16_t con_handle)
{
    return ble_t2r_v4_stop(con_handle);
}
#else
void ble_t2r_v4_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt) {}
void ble_t2r_v4_init(uint8_t init_type) {}
uint8_t ble_t2r_v4_start(uint16_t con_handle, uint8_t test_rx) {return 0;}
uint8_t ble_t2r_v4_stop(uint16_t con_handle) {return 0;}
#endif

#if WIRELESS_CON_VERS == 4
void ble_con_acl_tx_done(uint8_t link, uint8_t tx_idx);
void ble_con_acl_rx_done(uint8_t link, uint8_t rx_idx);
void ble_con_evt_start_do(uint8_t link);
void ble_con_end_cb_v5(uint8_t link);
void ble_t2r_v5_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt);
void ble_t2r_v5_init(uint8_t init_type);
uint8_t ble_t2r_v5_start(uint16_t con_handle, uint8_t test_rx);
uint8_t ble_t2r_v5_stop(uint16_t con_handle);

AT(.com_text.ble.isr.con)
void ble_con_acl_tx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_tx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_acl_rx_done_cb(uint8_t link, uint8_t rx_idx)
{
    ble_con_acl_rx_done(link, rx_idx);
}

AT(.com_text.ble.isr.con)
void ble_con_evt_start_do_cb(uint8_t link)
{
    ble_con_evt_start_do(link);
}

AT(.com_text.ble.isr.con)
void ble_con_end_cb(uint8_t link)
{
    ble_con_end_cb_v5(link);
}

void ble_con_established_cb(uint8_t link)
{
//    ble_con_established_cb_v5(link);
}

AT(.com_text.ble.isr.con)
void ble_con_anchor_ts_update_cb(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt)
{
    ble_t2r_v5_anchor_ts_update(link, anchor_ts, anchor_hus, evt_cnt);
}

void ble_audio_init_cb(uint8_t init_type)
{
    return ble_t2r_v5_init(init_type);
}

uint8_t ble_audio_start_cb(uint16_t con_handle, uint8_t test_rx, void *param)
{
    return ble_t2r_v5_start(con_handle, test_rx);
}

uint8_t ble_audio_stop_cb(uint16_t con_handle)
{
    return ble_t2r_v5_stop(con_handle);
}
#else
void ble_t2r_v5_anchor_ts_update(uint8_t link, uint32_t anchor_ts, uint16_t anchor_hus, uint evt_cnt) {}
void ble_t2r_v5_init(uint8_t init_type) {}
uint8_t ble_t2r_v5_start(uint16_t con_handle, uint8_t test_rx) {return 0;}
uint8_t ble_t2r_v5_stop(uint16_t con_handle) {return 0;}
#endif
